using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using VSSAHT.Transfer;
using VSS_AHT.DataAccess;
using VSSAHT.DataAccess;
namespace VSSAHT.Database
{
	public partial class RequireNumberMapper
	{
		#region ToEntity

		public static RequireNumber ToEntity(RequireNumber entity, RequireNumberDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
			entity.LimitNumber = businessobject.LimitNumber;
			entity.RequireCode = businessobject.RequireCode;
			entity.RequireID = businessobject.RequireID;
			entity.RequireName = businessobject.RequireName;
            entity.RemainNumber = businessobject.RemainNumber;
			entity.RowVersion = VersionConverter.ToBinary(businessobject.RowVersion);
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static RequireNumberDTO ToBusinessObject(RequireNumber entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new RequireNumberDTO
			{
				LimitNumber = entity.LimitNumber,
				RequireCode = entity.RequireCode,
				RequireID = entity.RequireID,
				RequireName = entity.RequireName,
                RemainNumber = entity.RemainNumber,
				RowVersion = VersionConverter.ToString(entity.RowVersion)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static RequireNumberDTO ToBusinessObjectHasChildren(RequireNumber entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			RequireNumberDTO businessobject = new RequireNumberDTO
			{
				LimitNumber = entity.LimitNumber,
				RequireCode = entity.RequireCode,
				RequireID = entity.RequireID,
				RequireName = entity.RequireName,
				RowVersion = VersionConverter.ToString(entity.RowVersion)
			};
			return businessobject;
		}

		#endregion

	}
}
